using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;

namespace ConsoleApplication2.Models.Mapping
{
    public class SO_Bills_no_ArMap : EntityTypeConfiguration<SO_Bills_no_Ar>
    {
        public SO_Bills_no_ArMap()
        {
            // Primary Key
            this.HasKey(t => new { t.DATE, t.number });

            // Properties
            this.Property(t => t.batch)
                .HasMaxLength(10);

            this.Property(t => t.BILL__)
                .HasMaxLength(8);

            this.Property(t => t.CASE__)
                .HasMaxLength(15);

            this.Property(t => t.PATIENT)
                .HasMaxLength(80);

            this.Property(t => t.Arabic_Name)
                .HasMaxLength(30);

            this.Property(t => t.PATIENT_ID)
                .HasMaxLength(6);

            this.Property(t => t.number)
                .IsRequired()
                .HasMaxLength(8);

            // Table & Column Mappings
            this.ToTable("SO_Bills_no_Ar");
            this.Property(t => t.batch).HasColumnName("batch");
            this.Property(t => t.BILL__).HasColumnName("BILL_#");
            this.Property(t => t.CASE__).HasColumnName("CASE_#");
            this.Property(t => t.DATE).HasColumnName("DATE");
            this.Property(t => t.PATIENT).HasColumnName("PATIENT");
            this.Property(t => t.Arabic_Name).HasColumnName("Arabic_Name");
            this.Property(t => t.PATIENT_ID).HasColumnName("PATIENT_ID");
            this.Property(t => t.closed).HasColumnName("closed");
            this.Property(t => t.number).HasColumnName("number");
        }
    }
}
